-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(FPI): Make storage maps usable by querying the node #645
Conversation
d732b42
to
b1ca66c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left some minor comments/questions.
/// | ||
/// At execution, the client queries the node and retrieves account-related data, based on | ||
/// what's defined in `foreign_accounts` | ||
pub fn with_foreign_accounts( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could end up with duplicate accounts when using with_foreign_accounts
/with_public_foreign_accounts
/with_private_foreign_accounts
. Maybe we could do a duplicate check when inserting or store them in a BTreeMap/Set. Plus, do we need all 3 methods? Maybe we could have just the first one, the creation of the ForeignAccount
items would need to be done by the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agree that it complicates things a bit. I unified the API into a single with_foreign_accounts
call. I think the advantage of keeping the other 2 instead of this one is that the user does not necessarily need to know about nor instantiate a ForeignAccount
enum variant, so maybe that is a nicer approach.
I also changed the builder to use a map (AccountId
-> ForeignAccount
) to handle duplicates.
decfe52
to
ac729ee
Compare
Talked to @bobbinth. Merging this for now, in order to make migration to the latest revisions of |
} | ||
|
||
let headers = if include_headers && account_id.is_public() { | ||
// Because we set `include_headers` to true, for any public account we requeted we |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Because we set `include_headers` to true, for any public account we requeted we | |
// Because we set `include_headers` to true, for any public account we requested we |
/// At execution, the client queries the node and retrieves the state and current code for | ||
/// these accounts, and injects them as advice inputs. | ||
/// Specifies one or more foreign accounts (public or private) that contain data | ||
/// utilized by the transaction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// utilized by the transaction. | |
/// used by the transaction. |
Implements changes following up 0xPolygonMiden/miden-node#598 in order to allow using storage maps on FPI.
This was a feature requested by pioneers.